#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n, a[801][2];
double f[801][801], dist[801];
bool b[801];
inline void Prim() {
	memset(b, false, sizeof(b));
	for (ll i = 1; i <= n; ++i)
		dist[i] = 1e100;
	dist[1] = 0;
	double ans = 0;
	for (ll i = 1; i <= n; ++i) {
		ll x = -1;
		for (ll j = 1; j <= n; ++j)
			if (!b[j] && dist[j] < 1e99)
				if (x == -1 || dist[j] < dist[x])
					x = j;
		ans += dist[x];
		b[x] = true;
		for (ll j = 1; j <= n; ++j)
			dist[j] = min(dist[j], f[x][j]);
	}
	printf("%.1f\n", ans);
}
int main() {
	scanf("%lld", &n);
	for (ll i = 1; i <= n; ++i)
		scanf("%lld%lld", &a[i][0], &a[i][1]);
	for (ll i = 1; i <= n; ++i)
		for (ll j = 1; j <= n; ++j)
			f[i][j] = sqrt((a[i][0] - a[j][0]) * (a[i][0] - a[j][0]) + (a[i][1] - a[j][1]) * (a[i][1] - a[j][1])); 
	Prim();			
	return 0;
}
